import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AdmCheckinApplicationVO, AdmCheckinApplicationForm, AdmCheckinApplicationQuery } from '@/api/general/administration/hostel/checkin/types';

/**
 * 查询员工入住宿舍申请列表
 * @param query
 * @returns {*}
 */

export const listAdmCheckinApplication = (query?: AdmCheckinApplicationQuery): AxiosPromise<AdmCheckinApplicationVO[]> => {
  return request({
    url: '/system/admCheckinApplication/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工入住宿舍申请详细
 * @param id
 */
export const getAdmCheckinApplication = (id: string | number): AxiosPromise<AdmCheckinApplicationVO> => {
  return request({
    url: '/system/admCheckinApplication/' + id,
    method: 'get'
  });
};

/**
 * 新增员工入住宿舍申请
 * @param data
 */
export const addAdmCheckinApplication = (data: AdmCheckinApplicationForm) => {
  return request({
    url: '/system/admCheckinApplication',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工入住宿舍申请
 * @param data
 */
export const updateAdmCheckinApplication = (data: AdmCheckinApplicationForm) => {
  return request({
    url: '/system/admCheckinApplication',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工入住宿舍申请
 * @param id
 */
export const delAdmCheckinApplication = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/admCheckinApplication/' + id,
    method: 'delete'
  });
};
